package com.neuedu.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neuedu.dao.ProviderDao;
import com.neuedu.model.Provider;
import com.neuedu.service.ProviderService;

//配置一个spring的服务，把业务实现类交给spring进行管理，由spring完成依赖注入
@Service
public class ProviderServiceImpl implements ProviderService {

	//织入-依赖注入
	@Autowired
	private ProviderDao ProviderDao;	
	public void setProviderDao(ProviderDao providerDao) {
		this.ProviderDao = providerDao;
	}

	@Override
	public int countProvider() {		
		return ProviderDao.countProvider();
	}

	@Override
	public List<Provider> findAll(Map<String, Object> map) {		
		return ProviderDao.findAll(map);
	}

	@Override
	public int addProvider(Provider p) {
		return ProviderDao.addProvider(p);
	}

	@Override
	public int updateProvider(Provider p) {
		return ProviderDao.updateProvider(p);
	}

	@Override
	public int deleteProvider(int id) {
		return ProviderDao.deleteProvider(id);
	}

}
